package com.me.batm.services;

import com.badlogic.gdx.Gdx;
import com.me.batm.GameConstants;

public class GameConfiguration {
	public static final String DIFFICULTY_NORMAL = "normal";
	public static final String DIFFICULTY_HARD = "hard";
	
	public static float getLevelTime(int level){
		return Gdx.app.getPreferences(GameConstants.GAME_NAME).getFloat(String.format("time_level%d_%s",level,getDifficulty()));
	}
	
	public static float getAngerConstant(){
		return Gdx.app.getPreferences(GameConstants.GAME_NAME).getFloat(String.format("anger_constant_%s",getDifficulty()));
	}
	
	public static float getConquerConstant(){
		return Gdx.app.getPreferences(GameConstants.GAME_NAME).getFloat(String.format("conquer_constant_%s",getDifficulty()));
	}
	
	public static float getGirlSpeed(){
		return Gdx.app.getPreferences(GameConstants.GAME_NAME).getFloat(String.format("girl_speed_%s",getDifficulty()));
	}
	
	public static int getNumberOfMaps(){
		return (int)Gdx.app.getPreferences(GameConstants.GAME_NAME).getFloat("number_of_maps");
	}
	
	public static int getActualLevel(){
		return Gdx.app.getPreferences(GameConstants.GAME_NAME).getInteger("starting_level");
	}
	
	public static void setActualLevel(int level){
		Gdx.app.getPreferences(GameConstants.GAME_NAME).putInteger("starting_level",level);
	}
	
	public static String getDifficulty(){
		return Gdx.app.getPreferences(GameConstants.GAME_NAME).getString("difficulty");
	}
	
	public static void setDifficulty(String difficulty){		
		Gdx.app.getPreferences(GameConstants.GAME_NAME).putString("difficulty",difficulty);
	}

	public static void setInitialValues() {
		setActualLevel(1);
		setDifficulty(DIFFICULTY_NORMAL);
	}
}
